/* part1test.c
 * test the syscall for the lock and condition
 */
#include "theater.h"

char * alL1="alL1";
char * rt1scl2="rt1scl2";
char * rt1scc2="rt1scc2";

void RT2AT1()
{
    CreateLock(alL1);
    Printf("rpctest 3:RT2AT1 try to acquire a lock that owned by RT1AT2 name RTAT\n");
    AcquireLock(alL1);
    Printf("rpctest 3:RT2AT1 got that owned by RT1AT2 name RTAT\n");
    ReleaseLock(alL1);
}

void RT1BC1()
{
   CreateLock(rt1scl2);
    CreateCV(rt1scc2);
    AcquireLock(rt1scl2);
    Printf("rpctest 3:RT1BC1 broadcast the lock %s  cv %s\n",rt1scl2,rt1scc2);
    BroadcastCV(rt1scl2,rt1scc2);
    Printf("rpctest 3:RT1BC1 release for the lock %s  cv %s\n",rt1scl2,rt1scc2);
    ReleaseLock(rt1scl2);
}


int main()
{
    RT1LO1();
    RT2AT1();
    RT1BC1();
    Exit(0);
}


 
